#include <stdio.h>

int main() {
    int n = 0;
    int i = 0;
    int sum = 0;
    for (n = 1; n <= 10; n++) {
        int ret = 1;
        for (i = 1; i <= n; i++) {
            ret *= i;
            printf("%d的阶乘为:%d\n", i,ret);
        }
        sum += ret;
        printf("%d的阶乘之和为%d\n", n, sum);
    }
    printf("%d\n", sum);
    return 0;
}